<div class="layui-card">
    <div class="layui-card-body" id="learn-statistics-div">
        <div class="layui-form toolbar">
            <button id="stage-iter-btn-add" class="layui-btn icon-btn"><i class="layui-icon">&#xe654;</i>添加</button>
        </div>
        <table class="layui-table" id="learn-content" lay-filter="learn-content-filter"></table>
    </div>
</div>

<script>
    layui.use([ 'table', 'admin'], function () {
        var table = layui.table;
        var config = layui.config;
        var admin = layui.admin;

        let value = admin.getTempData("t_learn_iter");
        // console.log(value)
        // 渲染表格
        table.render({
            elem: '#learn-content',
            url: config.base_server + 'api-study/learnIter/query',
            method: 'POST',
            where: {
                access_token: config.getToken().access_token,
                sicode: value.stcode,
                userid: value.userid
            },
            page: true,
            height: 'full-350',
            cols: [[
                {type: 'numbers'},
                {field: 'leitid',hide:true},
                {field: 'conten', title: '学习内容'},
                {field: 'statim', title: '内容开始时间'},
                {field: 'endtim',  title: '内容结束时间'},
                {field: 'unders',  title: '理解程度',edit:'text'},
                {field: 'practi',  title: '练习程度',edit:'text'},
            ]],
        })

        // 添加按钮点击事件
        $('#stage-iter-btn-add').click(function () {
            // admin.putTempData('t_stage_iter',sicode);
            admin.popupCenter2({
                title: '迭代内容评价',
                path: 'pages/learn/learn_iter.html',
                finish: function () {
                    table.reload('learn-content',{where:{sicode: value.stcode,userid: value.userid}});
                }
            });
        });

    })
</script>